class Device {
  final String id;
  final String name;
  final String status;
  final DateTime bindTime;

  Device({
    required this.id,
    required this.name,
    required this.status,
    required this.bindTime,
  });

  factory Device.fromJson(Map<String, dynamic> json) => Device(
    id: json['id'] as String,
    name: json['name'] as String,
    status: json['status'] as String,
    bindTime: DateTime.parse(json['bindTime'] as String),
  );

  Map<String, dynamic> toJson() => {
    'id': id,
    'name': name,
    'status': status,
    'bindTime': bindTime.toIso8601String(),
  };
}